Engine.Scene = function(){
    this.gameObjects = [];
    this.camera = new Engine.Camera();
    this.lights = [];
    var light1 = new Engine.Light(Engine.LightType.Directional,{r:0.5,g:0.5,b:0.9},new Engine.Vector3(-0.7071,0.7071,0));
    var light2 = new Engine.Light(Engine.LightType.Directional,{r:0.9,g:0.2,b:0.3},new Engine.Vector3(0,-0.7071,-0.7071));
    var light3 = new Engine.Light(Engine.LightType.Directional,{r:0.2,g:0.7,b:0.3},new Engine.Vector3(0.7071,0,-0.7071));
    var ambientlight = new Engine.Light(Engine.LightType.Ambient,{r:0.3,g:0.3,b:0.3});
    this.lights.push(light1);
    this.lights.push(light2);
	this.lights.push(light3);
	this.lights.push(ambientlight);
}

Engine.Scene.prototype = (function(){
    var idCount = 0;
    return {
        begin : function(width,height){
            this.width = width;
            this.height = height;
        },
        
        deleteGameObject : function(id){
            for(var i = 0; i < this.gameObjects.length ;i++){
                if(this.gameObjects[i].id == id){
                    this.gameObjects.remove(i);
                    return;
                }
            }
        },
        
        getGameObject : function(id){
             for(var i = 0; i < this.gameObjects.length ;i++){
                    if(this.gameObjects[i].id == id){
                        return this.gameObjects[i];
                    }
            }
        },
        
        addGameObject : function(object){
            if(object.id === undefined)
                object.id = idCount++;
            this.gameObjects.push(object);
        }
    };
})();